package com.forum.Mapper;

import com.forum.Entity.Post;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PostMapper {
    void addPost(Post post);

    List<Post> getPostList(String topicId, String title);

    String getUserIdBypostId(String postId);

    Post getPostDetail(@Param("postId")String postId, @Param("userId")String userId);

    void updatePost(Post post);

    Post getPostById(String postId);

    List<Post> getHotPosts();

    int getPostCount();

    int getTodayPosts();

    List<Post> getPostListByNewest(String topicId, String title);

    List<Post> getPostListByMostViews(String topicId, String title);

    List<Post> getPostListByMostComments(String topicId, String title);

    List<Post> getPostListByMostLikes(String topicId, String title);


    //wode
    List<Post> getMyPostListByNewest(String title,String topicId,String userId);

    List<Post> getMyPostListByMostViews(String title,String topicId,String userId);

    List<Post> getMyPostListByMostComments(String title,String topicId,String userId);

    List<Post> getMyPostListByMostLikes(String title,String topicId,String userId);

    List<Post> getMyPostList(String title,String topicId,String userId);

    void deletePost(String postId);

    List<Post> getPostLists(String topicId, String title);

    List<Post> getPostListByTitle(String title);
}
